<%-- 
    Document   : admin_home
    Created on : 16 Jan, 2013, 7:27:53 PM
    Author     : s
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
 <%@include file="connection.jsp" %>

<!DOCTYPE html>
<html>
    <head>
            
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Dashboard - Admin Template</title>
        <link rel="stylesheet" type="text/css" href="css/theme.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <script>
                var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
                document.writeln('<link rel="stylesheet" type="text/css" href="css/' + StyleFile + '">');
        </script>   
        <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
        <![endif]-->
        <%@include file="validation.jsp" %>

        <link rel="stylesheet" href="js/jquery-ui-1.8.23.custom/development-bundle/themes/base/jquery.ui.all.css">
       
        <script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.accordion.js"></script>
        
         
        <script>
    $(function() {
		$( "#sidebar" ).accordion({
			autoHeight:false,
                        event: "mouseover"
		});
	});
    
</script>
    </head>
    <body>
        <%  
        String id1=null;
            int id = 0;
             String f_nm=null,lnm=null,em=null,mo=null,pass=null;
      //  if(Integer.parseInt(request.getParameter("id").toString())!=-1)
        if(request.getParameter("id")!=null)               
                       {
            id1 = request.getParameter("id").toString();
            id = Integer.parseInt(id1);
            st = con.createStatement();
            rs = st.executeQuery("select f_name,l_name,e_mail,mo_no,DES_DECRYPT(password) from user where sr_no = "+id+"");
         
            while(rs.next())
            {
                
                f_nm = rs.getString(1);
                lnm =rs.getString(2);
                em=rs.getString(3);
                mo=rs.getString(4);
                pass=rs.getString(5);
            }
                    }
        %>
        <div id="container">
                <div id="header">
                    <h2>Stock Market Website</h2>
                    <div id="topmenu">
                      <ul>
                	<li><a href="admin_home.jsp">Dashboard</a></li>
                        <li class="current"><a href="admin_users.jsp">Users</a></li>
                        <li><a href="companies.jsp">Companies</a></li>
                        <li><a href="charts.jsp">Charts</a></li>
                        <!--<li><a href="chatgroup.jsp">Chat Group</a></li>-->
                        <li><a href="experts.jsp">Experts</a></li>
                        <!--                    <li><a href="emails.jsp">Emails</a></li>-->
                      </ul>
                    </div>
                </div>
        
        <div id="wrapper">
            <div id="content">
                <%@include file="header.jsp" %>
                <div id="box">
                    <h3>User</h3>
                    
                
                 <form  method = "POST"  action="user_add_update_back.jsp" id="valid" class="formular">
            <table border="1">
                <tbody>
                    <tr>
                        <td>First Name</td>
                        <td id="test">
                            <input type="hidden" name="id" value='<% if(id1!=null)out.print(id);else out.print("");%>' />
                            <input type="text" name="f_nm" value="<%if(id1!=null)out.println(f_nm);%>" size="20" class="validate[required] text-input"/></td>
                    </tr>
                    <tr>
                        <td>Last Name</td>
                        <td><input type="text" name="l_nm" value="<%if(id1!=null)out.println(lnm);%>" size="20" class="validate[required] text-input"/></td>
                    </tr>
                    <tr>
                        <td>E-mail</td>
                        <td><input type="text" name="email" value="<%if(id1!=null)out.println(em);%>" size="20" class="validate[required] text-input"/></td>
                    </tr>
                    <tr>
                        <td>Password</td>
                        <td><input type="password" name="pass" value="<%if(id1!=null)out.println(pass);%>" size="20" id="password" class="validate[required,minSize[6]] text-input"/></td>
                    </tr>
                    <tr>
                        <td>Mobile No</td>
                        <td><input type="text" name="mo_no" value="<%if(id1!=null)out.println(mo);%>" size="20" class="validate[required,custom[phone]] text-input"/></td>
                    </tr>
                    <tr>
                        <td>Choose Package</td>
                        <td><select name="package" class="validate[required] text-input">
                                <option value="" selected="">--Choose Package--</option>
                                <option value="micro" >MICRO</option>
                                <option value="mini">MINI</option>
                                <option value="kilo">KILO</option>
                                <option value="mega">MEGA</option>
                                <option value="giga">GIGA</option>
                            </select></td>
                    </tr>
                    <tr>
                        <td><input type="submit" value="<%if(id1!=null)out.print("UPDATE");else out.print("ADD USER");%>" name="submit" /></td>
                        <td><input type="reset" value="RESET" name="reset" /></td>
                    </tr>
                </tbody>
            </table>




        </form>
               
                    
                   
                               
                
                </div> 
                <p>&nbsp;</p>
            </div>
                       
            

        <div id="sidebar">
  	
                	<li><h3><a href="#" class="house">Dashboard</a></h3>
                        <ul>
                        	<li><a href="logout.jsp" class="report">Logout</a></li>
                        </ul>
                    </li>
                    
                   
                  <li><h3><a href="#" class="user">Users</a></h3>
          				<ul>
                            <li><a href="#" class="useradd">Add user</a></li>
                            
            				<li><a href="find_user.jsp" class="search">Find user</a></li>
                            
                        </ul>
                    </li>
				       
          </div>
      </div>
        <div id="footer">
        <div id="styleswitcher">
            <ul>
                <li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
                <li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
                <li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
                <li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
                <li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
                <li><a href="javascript: document.cookie='theme=5'; window.location.reload();" title="Mix" id="defswitch">m</a></li>
            </ul>
        </div><br />

        </div>
</div>
</body>
</html>
